import request from '@/router/axios';

// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/plan/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
// 删除
export const remove = (ids) => {
  return request({
    url: '/api/hg-equipment/plan/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

// 提交
export const commit = (id) => {
  return request({
    url: '/api/hg-equipment/plan/commit',
    method: 'get',
    params: {
      id
    }
  })
}

// 详情
export const detail = (id) => {
  return request({
    url: '/api/hg-equipment/plan/info',
    method: 'get',
    params: {
      id
    }
  })
}

// 保存
export const save = (data,ids) => {
  return request({
    url: '/api/hg-equipment/plan/save',
    method: 'post',
    data: data,
    params: {
      ids
    }
  })
}

// 启动或关闭计划
export const execute = (flag,id) => {
  return request({
    url: '/api/hg-equipment/plan/execute',
    method: 'get',
    params: {
      flag,
      id
    }
  })
}

// 获取部门
export const getDept = (parentId) => {
  return request({
    url: '/api/blade-system/dept/lazy-list',
    method: 'get',
    params: {
      parentId
    }
  })
}

// 规范列表
export const pullList = () => {
  return request({
    url: '/api/hg-equipment/maintain/pullList',
    method: 'get'
  })
}

// 设备列表
export const pullEptList = (locName,equipmentGroup) => {
  return request({
    url: '/api/hg-public/account/pullList',
    method: 'get',
    params: {
      equipmentGroup,
      locName
    }
  })
}

export const removeEp = (id) => {
  return request({
    url: '/api/hg-equipment/plan/removeEp',
    method: 'post',
    params: {
      id
    }
  })
}
